package behavioral.observer;

public class Sheet implements Observer {
    private final DataSource dataSource;

    public Sheet(DataSource dataSource) {
        this.dataSource = dataSource;
        this.dataSource.addObserver(this);
    }

    @Override
    public void update() {
        System.out.println("Sheet updated with new value: " + dataSource.getValue());
    }
}
